//
//  CollisionEffect.m
//  GamePOPs
//
//  Created by Thi Huynh on 3/19/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CollisionEffect.h"

@implementation CollisionEffect
-(id) init
{
	return [self initWithTotalParticles:15];
}
-(id)initCollisonWithColor:(ccColor3B)color WithPosisiton:(CGPoint)position
{
    if( (self=[super initWithTotalParticles:15]) ) 
    {
        
        // duration
		duration = 0.1f;
		
		//self.emitterMode = kCCParticleModeGravity;
        
		// Gravity Mode: gravity
		self.gravity = ccp(0,0);
		
		// Gravity Mode: speed of particles
		self.speed = 200;
		self.speedVar = 150;
		
		// Gravity Mode: radial
		self.radialAccel = 0;
		self.radialAccelVar = 0;
		
		// Gravity Mode: tagential
		self.tangentialAccel = 0;
		self.tangentialAccelVar = 0;
		
		// angle
		angle = 360;
		angleVar = 360;
        
		// emitter position
		self.position = position;
		posVar = CGPointZero;
		
		// life of particles
		life = 0.3f;
		lifeVar = 0.8f;
		
		// size, in pixels
		startSize = 25.0f;
		startSizeVar =17.0f;
		endSize = 9.0f;
        
		// emits per second
		emissionRate = totalParticles/duration;
		
		// color of particles
		startColor.r = color.r;
		startColor.g = color.g;
		startColor.b = color.b;
		startColor.a = 1.0f;
		
		self.texture = [[CCTextureCache sharedTextureCache] addImage: @""];
        
		//additive
		//self.blendAdditive = YES;	
    }
	
	return self;
    
    
}

@end
